package Cantella::DJabberd::Model::Admin::User::Action::Create;

use Reaction::Class;
use aliased 'Reaction::InterfaceModel::Action::DBIC::ResultSet::Create' =>
    'DBIC_Create';

#use Reaction::Types::Core qw( NonEmptySimpleStr Password);

class Create is DBIC_Create, which {

#  has username  => ( is => 'rw', isa => NonEmptySimpleStr, lazy_fail => 1 );
#  has password  => ( is => 'rw', isa => Password, lazy_fail => 1 );
#  has full_name => ( is => 'rw', isa => NonEmptySimpleStr, lazy_fail => 1 );

  has roles =>
    (
     is  => 'rw',
     isa => 'ArrayRef',
     valid_values => sub {
        shift->target_model->result_source
          ->related_source('user_roles')
            ->related_source('role')->resultset;
     }
    );
};

1;
